<template>
  <view class="colorB padding-10  ">
    <uni-title title="会员信息" />
    <view class="border-10 mainColor">
      <!-- <view class="padding-10">会员昵称：{{dialogForm.nickname}}</view> -->
      <view class="padding-10">会员邮箱：{{dialogForm.email}}</view>
      <!-- <view class="padding-10">会员性别：{{dialogForm.gender === 'FEMALE'?'女':'男'}}</view> -->
      <view class="padding-10">公司地址：{{dialogForm.location}}</view>
    </view>
    <uni-title title="汇付结算账户" />
    <view class="border-10 mainColor" v-for="(item,index) in settleAccountList" :key="index">
      <view class="padding-10">
        银行账户类型：{{item.bankAcctType === '1'? '对公':'对私'}}
      </view>
      <view class="padding-10">银行卡号：{{item.cardId}}</view>
      <view class="padding-10">银行卡对应的户名：{{item.cardName}}</view>
      <view class="padding-10">手机号：{{item.telNo}}</view>
      <view class="padding-10">银行编码：{{item.bankCode}}</view>
      <view class="padding-10">银行账户开户银行所在省份编码：{{provCode(item.provCode)}}/ {{areaCode(item.areaCode)}}</view>
    </view>
  </view>
</template>

<script>
  // createAdapayMember,
  // createCorpMember,
  // createSettleAccount
  import {
    selectAdapayMember,

  } from "@/api/adapayMember/adapayMember";
  export default {
    props: ['merchantId'],
    data() {
      return {
        dialogForm: {}, // 汇付会员 对象
        settleAccountList: [], // 汇付结算账户数组
        options: [] // 省份编码数组
      }
    },
    methods: {
      areaCode(area) {
        let arr = this.options.find(item => item.cities[0].value == area)
        return arr.title
      },
      provCode(code) {
        let arr = this.options.find(item => item.value == code)
        return arr.title
      },
      jsonHttp() {
        var that = this;
        uni.request({
          url: "https://cdn.cloudpnr.com/adapayresource/documents/Adapay%E7%9C%81%E5%B8%82%E7%BC%96%E7%A0%81%EF%BC%88%E5%9B%9B%E4%BD%8D%EF%BC%89.json",
          success: function(res) {
            that.options = res.data
          }
        })

      },
      // 查询汇付会员基本信息
      selectAdapayMember() {
        console.log("this.merchantId", this.merchantId);
        let param = {
          merchantId: this.merchantId,
        };
        selectAdapayMember(param).then((response) => {
          console.log("查询 selectAdapayMember", response);
          this.adapayMember = response.data;
          if (response.data != null) {
            this.dialogForm = response.data.adapayMember;
            this.settleAccountList = response.data.settleAccountList
            console.log(' this.settleAccountList', this.settleAccountList)
          }
        });
      },

    },
    created() {
      this.selectAdapayMember();
      this.jsonHttp();
    }
  }
</script>

<style>
</style>